<?php
$action = $this->layout()->action;
$router =$this->layout()->router;
$id =$this->layout()->id;
 if ($this->pageCount): ?>
 
        <ul class="pagination pagination-centered">
            <li <?php echo!isset($this->previous) ? 'class="disabled"' : ''; ?>>
                <a href="<?php echo $this->url($router, array('action'=>$action,'id'=>$id)).'?page='.$this->first; ?>">&laquo;</a></li>
            <li <?php echo!isset($this->previous) ? 'class="disabled"' : ''; ?>>
                <a href="<?php echo $this->url($router, array('action'=>$action,'id'=>$id)).'?page='. $this->previous; ?>">&lsaquo;</a></li>


            <!-- Numbered page links -->
            <?php foreach ($this->pagesInRange as $page): ?>
                <li <?php echo $page == $this->current ? 'class="active"' : ''; ?>><a href="<?php echo $this->url($router, array('action'=>$action,'id'=>$id)).'?page='.$page; ?>">
                        <?php echo $page; ?>
                    </a></li>
            <?php endforeach; ?>

            <!-- Next page link -->
            <li <?php echo!isset($this->next) ? 'class="disabled"' : ''; ?>>
                <a href="<?php echo $this->url($router, array('action'=>$action,'id'=>$id)).'?page='.$this->next; ?>">&rsaquo;</a></li>
            <!-- Last page link -->
            <li <?php echo!isset($this->next) ? 'class="disabled"' : ''; ?>>
                <a href="<?php echo $this->url($router, array('action'=>$action,'id'=>$id)).'?page='.$this->last; ?>">&raquo;</a></li>
        </ul>
  
<?php endif; ?>